package com.thread;

import sun.nio.ch.ThreadPool;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Test04 implements Runnable{
    public static void main(String[] args) {
        // 创建线程池
        ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 10, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<>());
        executor.execute(new Test04());

        Executors.newFixedThreadPool(3);
    }

    @Override
    public void run() {
        System.out.println("通过线程池来启动线程");
    }
}
